#ifndef QWORLDSCENE_H
#define QWORLDSCENE_H

#include <QMap>
#include <QGraphicsScene>

class QLife;
class QLifeGraphicsItem;
class QGraphicsEllipseItem;

/**
	@author Stefan Weigert <stefan.weigert@mailbox.tu-dresden.de>
*/
class QWorldScene : public QGraphicsScene
{
		Q_OBJECT
	public:
		QWorldScene ( int width, int height, QObject *parent = 0 );

		~QWorldScene();

		void setDimension ( int width, int height );
		void addLife ( QLife* life, QLifeGraphicsItem* item );
		QList<QGraphicsItem*> getIntersectingItems ( long id, float viewDistance );
		void reset();
		void removeLife ( long id );
		void updateLife ( QLife* life );

	public slots:
		void drawLines ( bool lines );
		void drawCircles ( bool circles );

	private:
		bool lines;
		bool circles;

		QMap<long, QLifeGraphicsItem*> lifeMap;

		QGraphicsRectItem* dimRect;
		QGraphicsEllipseItem* viewAngle;

};

#endif
